//
//  CertifiTableViewCell.m
//  Village
//
//  Created by longrise on 2017/9/15.
//  Copyright © 2017年 程虎. All rights reserved.
//

#import "CertifiTableViewCell.h"

@implementation CertifiTableViewCell

- (instancetype) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self addAllViews];
        
    }
    return self;
}

- (void)addAllViews
{
    _leftlable = [[UILabel alloc] init];
    _leftlable.text = @"我的文章";
    _leftlable.backgroundColor = [UIColor whiteColor];
    _leftlable.font = [UIFont systemFontOfSize:17*kScreenScaleX];
    [_leftlable setTextAlignment : NSTextAlignmentLeft] ;
    [self.contentView addSubview:_leftlable];
    [_leftlable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).offset(15*kScreenScaleX);//使左边等于self.view的左边，间距为0
        //        make.top.equalTo(self.mas_top).offset(10);//使顶部与self.ScrollWebView的底部间距为0
        make.width.mas_equalTo(90*kScreenScaleX);
        make.height.mas_equalTo(30*kScreenScaleY);
        make.centerY.equalTo(self);
    }];
    
    _rightlable = [[UILabel alloc] init];
    _rightlable.text = @"666666";
    _rightlable.backgroundColor = [UIColor whiteColor];
    _rightlable.textColor = [Util colorWithHexString:@"999999"];
    _rightlable.font = [UIFont systemFontOfSize:17*kScreenScaleX];
    //自适应宽度(将字体缩放，以致所有的文字都显示全)
    //    [_rightlable setAdjustsFontSizeToFitWidth:YES];
    [_rightlable setTextAlignment : NSTextAlignmentRight] ;
    [self.contentView addSubview:_rightlable];
    
    [_rightlable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.mas_right).offset(-35*kScreenScaleX);//使左边等于self.view的左边，间距为0
        //        make.top.equalTo(self.mas_top).offset(10);//使顶部与self.ScrollWebView的底部间距为0
        make.width.mas_equalTo(180*kScreenScaleX);;
        make.height.mas_equalTo(30*kScreenScaleY);
        make.centerY.equalTo(self);
    }];
    
    
    _conterlable = [[UILabel alloc] init];
    _conterlable.textColor = [UIColor redColor];
    _conterlable.font = [UIFont systemFontOfSize:18*kScreenScaleX];
    _conterlable.text = @"退出登录";
    [_conterlable setTextAlignment : NSTextAlignmentCenter] ;
    [self.contentView addSubview:_conterlable];
    
    [_conterlable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.mas_equalTo(170*kScreenScaleX);;
        make.height.mas_equalTo(17*kScreenScaleY);
        make.centerY.equalTo(self);
        make.centerX.equalTo(self);
    }];
    
    
    
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
